#include <iostream>
#include <cstdio>
using namespace std;
int n;

int main() {
	int sum=0;
	cin>>n;
	int maxs=-1,mins=1005;
	for(int i=1;i<=n;i++){
		double x;
		cin>>x;
		int i_x=x*100;
		sum+=i_x;
		if(i_x>maxs) maxs=i_x;
		if(i_x<mins) mins=i_x;
	}
	sum-=(maxs+mins);
	printf("%.2f",sum/100.0/(n-2));
	return 0;
}
